<form id="edit-form" class="form-horizontal" role="form" data-toggle="validator" method="POST" action="">
    <div class="alert alert-danger-light">
        <b>温馨提示</b><br>
        小区地址信息中填写的了经纬度，则不会根据省市区街道及详细地址解析经纬度<br>
        小区地址信息中未填写经纬度，则会根据省市区街道及详细地址解析经纬度<br>
        小区的最近地铁、附近地铁是根据小区经纬度与地铁站台经纬度计算出来的距离，与通用配置-房源配置里的地铁房距离（m）进行比对获取的
    </div>
    <ul class="nav nav-tabs" >
        <li class="active">
            <a href="#tab-general" data-toggle="tab" aria-expanded="false">基本信息</a>
        </li>
        <li class="">
            <a href="#tab-address" data-toggle="tab" aria-expanded="false">地址信息</a>
        </li>
    </ul>
    <div class="tab-content" style="padding-top: 10px;">
        <div class="tab-pane active" id="tab-general">
            <div class="form-group">
                <label class="control-label col-xs-12 col-sm-2">{:__('Name')}:</label>
                <div class="col-xs-12 col-sm-8">
                    <input id="c-name" class="form-control" name="row[name]" type="text" value="{$row.name|htmlentities}">
                </div>
            </div>
            <div class="form-group">
                <label class="control-label col-xs-12 col-sm-2">{:__('Broker_user_ids')}:</label>
                <div class="col-xs-12 col-sm-8">
                    <input id="c-broker_user_ids" data-source="xiluhouse/user/user/index" data-multiple="true" data-field="nickname" data-params='{"custom[userprofile.is_broker]":2}' class="form-control selectpage" name="row[broker_user_ids]" type="text" value="{$broker_user_ids}">
                </div>
            </div>
            <div class="form-group">
                <label class="control-label col-xs-12 col-sm-2">{:__('Weigh')}:</label>
                <div class="col-xs-12 col-sm-8">
                    <input id="c-weigh" class="form-control" name="row[weigh]" type="number" value="{$row.weigh|htmlentities}">
                </div>
            </div>
            <div class="form-group">
                <label class="control-label col-xs-12 col-sm-2">{:__('Status')}:</label>
                <div class="col-xs-12 col-sm-8">

                    <div class="radio">
                        {foreach name="statusList" item="vo"}
                        <label for="row[status]-{$key}"><input id="row[status]-{$key}" name="row[status]" type="radio" value="{$key}" {in name="key" value="$row.status"}checked{/in} /> {$vo}</label>
                        {/foreach}
                    </div>

                </div>
            </div>
            <div class="form-group">
                <label class="control-label col-xs-12 col-sm-2">{:__('Check_status')}:</label>
                <div class="col-xs-12 col-sm-8">

                    <div class="radio">
                        {foreach name="checkStatusList" item="vo"}
                        <label for="row[check_status]-{$key}"><input id="row[check_status]-{$key}" name="row[check_status]" type="radio" value="{$key}" {in name="key" value="$row.check_status"}checked{/in} /> {$vo}</label>
                        {/foreach}
                    </div>

                </div>
            </div>
        </div>

        <div class="tab-pane" id="tab-address">
            <div class="form-group">
                <label class="control-label col-xs-12 col-sm-2">省市区街道:</label>
                <div class="col-xs-12 col-sm-8">
                    <div class="form-inline" data-toggle="cxselect" data-selects="prov,city,region,street">
                        <select class="prov form-control" data-rule="required" name="prov" data-url="xiluhouse/ajax/area">
                            <option value="{$row.prov}" selected="">{$row.prov}</option>
                        </select>
                        <select class="city form-control" data-rule="required" name="city" data-url="xiluhouse/ajax/area">
                            <option value="{$row.city}" selected="">{$row.city}</option>
                        </select>
                        <select class="region form-control" data-rule="required" name="region" data-url="xiluhouse/ajax/area">
                            <option value="{$row.region}" selected="">{$row.region}</option>
                        </select>
                        <select class="street form-control" data-rule="required" name="street" data-url="xiluhouse/ajax/area">
                            <option value="{$row.street}" selected="">{$row.street}</option>
                        </select>
                    </div>
                </div>
            </div>
            <div class="form-group">
                <label class="control-label col-xs-12 col-sm-2">{:__('Addr')}:</label>
                <div class="col-xs-12 col-sm-8">
                    <input id="c-addr" data-rule="required" class="form-control" name="row[addr]" type="text" value="{$row.addr|htmlentities}">
                </div>
            </div>
            <div style="color: #18bc9c;" data-toggle="addresspicker" data-lat-id="c-lat" data-lng-id="c-lng">点击这里打开地图选择经纬度（如果不填写经纬度，则会自动根据填写的地址生成经纬度）</div>
            <div class="form-group">
                <label class="control-label col-xs-12 col-sm-2">{:__('Lat')}:</label>
                <div class="col-xs-12 col-sm-8">
                    <input id="c-lat" class="form-control" name="row[lat]" type="text" value="{$row.lat|htmlentities}">
                </div>
            </div>
            <div class="form-group">
                <label class="control-label col-xs-12 col-sm-2">{:__('Lng')}:</label>
                <div class="col-xs-12 col-sm-8">
                    <input id="c-lng" class="form-control" name="row[lng]" type="text" value="{$row.lng|htmlentities}">
                </div>
            </div>
            <div class="form-group">
                <label class="control-label col-xs-12 col-sm-2">{:__('Nearby_bus_num')}:</label>
                <div class="col-xs-12 col-sm-8">
                    <input id="c-nearby_bus_num" class="form-control" name="row[nearby_bus_num]" type="number" value="{$row.nearby_bus_num|htmlentities}">
                </div>
            </div>
            <div class="form-group">
                <label class="control-label col-xs-12 col-sm-2">{:__('Nearby_subway_num')}:</label>
                <div class="col-xs-12 col-sm-8">
                    <input id="c-nearby_subway_num" class="form-control" name="row[nearby_subway_num]" type="number" value="{$row.nearby_subway_num|htmlentities}">
                </div>
            </div>
            <div class="form-group">
                <label class="control-label col-xs-12 col-sm-2">{:__('Nearby_school_num')}:</label>
                <div class="col-xs-12 col-sm-8">
                    <input id="c-nearby_school_num" class="form-control" name="row[nearby_school_num]" type="number" value="{$row.nearby_school_num|htmlentities}">
                </div>
            </div>
            <div class="form-group">
                <label class="control-label col-xs-12 col-sm-2">{:__('Nearby_shop_num')}:</label>
                <div class="col-xs-12 col-sm-8">
                    <input id="c-nearby_shop_num" class="form-control" name="row[nearby_shop_num]" type="number" value="{$row.nearby_shop_num|htmlentities}">
                </div>
            </div>
            <div class="form-group">
                <label class="control-label col-xs-12 col-sm-2">{:__('Nearby_hospital_num')}:</label>
                <div class="col-xs-12 col-sm-8">
                    <input id="c-nearby_hospital_num" class="form-control" name="row[nearby_hospital_num]" type="number" value="{$row.nearby_hospital_num|htmlentities}">
                </div>
            </div>
            <div class="form-group">
                <label class="control-label col-xs-12 col-sm-2">{:__('Nearby_bus_json')}:</label>
                <div class="col-xs-12 col-sm-8">
                    <dl class="fieldlist" data-name="row[nearby_bus_json]" data-template="nearbybusjsontpl">
                        <dd>
                            <ins>名称</ins>
                            <ins>经度</ins>
                            <ins>纬度</ins>
                            <ins>距离</ins>
                        </dd>
                        <dd>
                            <a href="javascript:;" class="btn btn-sm btn-success btn-append"><i class="fa fa-plus"></i> 追加</a>
                        </dd>
                        <textarea name="row[nearby_bus_json]" class="form-control hide" cols="50" rows="5">{$row.nearby_bus_json|htmlentities}</textarea>
                    </dl>
                </div>
            </div>
            <div class="form-group">
                <label class="control-label col-xs-12 col-sm-2">{:__('Nearby_subway_json')}:</label>
                <div class="col-xs-12 col-sm-8">
                    <dl class="fieldlist" data-name="row[nearby_subway_json]" data-template="nearbysubwayjsontpl">
                        <dd>
                            <ins>名称</ins>
                            <ins>经度</ins>
                            <ins>纬度</ins>
                            <ins>距离</ins>
                        </dd>
                        <dd>
                            <a href="javascript:;" class="btn btn-sm btn-success btn-append"><i class="fa fa-plus"></i> 追加</a>
                        </dd>
                        <textarea name="row[nearby_subway_json]" class="form-control hide" cols="50" rows="5">{$row.nearby_subway_json|htmlentities}</textarea>
                    </dl>
                </div>
            </div>
            <div class="form-group">
                <label class="control-label col-xs-12 col-sm-2">{:__('Nearby_school_json')}:</label>
                <div class="col-xs-12 col-sm-8">
                    <dl class="fieldlist" data-name="row[nearby_school_json]" data-template="nearbyschooljsontpl">
                        <dd>
                            <ins>名称</ins>
                            <ins>经度</ins>
                            <ins>纬度</ins>
                            <ins>距离</ins>
                        </dd>
                        <dd>
                            <a href="javascript:;" class="btn btn-sm btn-success btn-append"><i class="fa fa-plus"></i> 追加</a>
                        </dd>
                        <textarea name="row[nearby_school_json]" class="form-control hide" cols="50" rows="5">{$row.nearby_school_json|htmlentities}</textarea>
                    </dl>
                </div>
            </div>
            <div class="form-group">
                <label class="control-label col-xs-12 col-sm-2">{:__('Nearby_shop_json')}:</label>
                <div class="col-xs-12 col-sm-8">
                    <dl class="fieldlist" data-name="row[nearby_shop_json]" data-template="nearbyshopjsontpl">
                        <dd>
                            <ins>名称</ins>
                            <ins>经度</ins>
                            <ins>纬度</ins>
                            <ins>距离</ins>
                        </dd>
                        <dd>
                            <a href="javascript:;" class="btn btn-sm btn-success btn-append"><i class="fa fa-plus"></i> 追加</a>
                        </dd>
                        <textarea name="row[nearby_shop_json]" class="form-control hide" cols="50" rows="5">{$row.nearby_shop_json|htmlentities}</textarea>
                    </dl>
                </div>
            </div>
            <div class="form-group">
                <label class="control-label col-xs-12 col-sm-2">{:__('Nearby_hospital_json')}:</label>
                <div class="col-xs-12 col-sm-8">
                    <dl class="fieldlist" data-name="row[nearby_hospital_json]" data-template="nearbyhospitaljsontpl">
                        <dd>
                            <ins>名称</ins>
                            <ins>经度</ins>
                            <ins>纬度</ins>
                            <ins>距离</ins>
                        </dd>
                        <dd>
                            <a href="javascript:;" class="btn btn-sm btn-success btn-append"><i class="fa fa-plus"></i> 追加</a>
                        </dd>
                        <textarea name="row[nearby_hospital_json]" class="form-control hide" cols="50" rows="5">{$row.nearby_hospital_json|htmlentities}</textarea>
                    </dl>
                </div>
            </div>

            <div class="form-group">
                <label class="control-label col-xs-12 col-sm-2">{:__('subway_distance')}:</label>
                <div class="col-xs-12 col-sm-8">
                    <input id="c-subway_distance" disabled class="form-control" name="row[subway_distance]" type="number" value="{$row.subway_distance|htmlentities}">
                </div>
            </div>
            <div class="form-group">
                <label class="control-label col-xs-12 col-sm-2">{:__('subway_distance_text')}:</label>
                <div class="col-xs-12 col-sm-8">
                    <input id="c-subway_distance_text" disabled class="form-control" name="row[subway_distance_text]" type="text" value="{$row.subway_distance_text|htmlentities}">
                </div>
            </div>
        </div>
    </div>

    <div class="form-group layer-footer">
        <label class="control-label col-xs-12 col-sm-2"></label>
        <div class="col-xs-12 col-sm-8">
            <button type="submit" class="btn btn-success btn-embossed disabled">{:__('OK')}</button>
            <button type="reset" class="btn btn-default btn-embossed">{:__('Reset')}</button>
        </div>
    </div>
</form>
<script type="text/html" id="nearbybusjsontpl">
    <dd class="form-inline">
        <input type="text" name="row[<%=name%>][<%=index%>][name]" class="form-control" placeholder="名称" value="<%=row['name']%>" size="10">
        <input type="text" id="nearby_lng_bus_<%=index%>" name="row[<%=name%>][<%=index%>][lng]" placeholder="经度" class="form-control" value="<%=row['lng']%>" size="10">
        <input type="text" id="nearby_lat_bus_<%=index%>" name="row[<%=name%>][<%=index%>][lat]" placeholder="纬度" class="form-control" value="<%=row['lat']%>" size="10">
        <input type="text" name="row[<%=distance%>][<%=index%>][distance]" class="form-control" placeholder="距离" value="<%=row['distance']%>" size="10">
        <span class="btn btn-sm btn-danger btn-remove"><i class="fa fa-times"></i></span> <span class="btn btn-sm btn-primary btn-dragsort"><i class="fa fa-arrows"></i></span>
        <div style="color: #18bc9c;" data-toggle="addresspicker" data-lat-id="nearby_lat_bus_<%=index%>" data-lng-id="nearby_lng_bus_<%=index%>">点击这里打开地图选择经纬度</div>
    </dd>
</script>
<script type="text/html" id="nearbysubwayjsontpl">
    <dd class="form-inline">
        <input type="text" name="row[<%=name%>][<%=index%>][name]" class="form-control" placeholder="名称" value="<%=row['name']%>" size="10">
        <input type="text" id="nearby_lng_subway_<%=index%>" name="row[<%=name%>][<%=index%>][lng]" placeholder="经度" class="form-control" value="<%=row['lng']%>" size="10">
        <input type="text" id="nearby_lat_subway_<%=index%>" name="row[<%=name%>][<%=index%>][lat]" placeholder="纬度" class="form-control" value="<%=row['lat']%>" size="10">
        <input type="text" name="row[<%=distance%>][<%=index%>][distance]" class="form-control" placeholder="距离" value="<%=row['distance']%>" size="10">
        <span class="btn btn-sm btn-danger btn-remove"><i class="fa fa-times"></i></span> <span class="btn btn-sm btn-primary btn-dragsort"><i class="fa fa-arrows"></i></span>
        <div style="color: #18bc9c;" data-toggle="addresspicker" data-lat-id="nearby_lat_subway_<%=index%>" data-lng-id="nearby_lng_subway_<%=index%>">点击这里打开地图选择经纬度</div>
    </dd>
</script>
<script type="text/html" id="nearbyschooljsontpl">
    <dd class="form-inline">
        <input type="text" name="row[<%=name%>][<%=index%>][name]" class="form-control" placeholder="名称" value="<%=row['name']%>" size="10">
        <input type="text" id="nearby_lng_school_<%=index%>" name="row[<%=name%>][<%=index%>][lng]" placeholder="经度" class="form-control" value="<%=row['lng']%>" size="10">
        <input type="text" id="nearby_lat_school_<%=index%>" name="row[<%=name%>][<%=index%>][lat]" placeholder="纬度" class="form-control" value="<%=row['lat']%>" size="10">
        <input type="text" name="row[<%=distance%>][<%=index%>][distance]" class="form-control" placeholder="距离" value="<%=row['distance']%>" size="10">
        <span class="btn btn-sm btn-danger btn-remove"><i class="fa fa-times"></i></span> <span class="btn btn-sm btn-primary btn-dragsort"><i class="fa fa-arrows"></i></span>
        <div style="color: #18bc9c;" data-toggle="addresspicker" data-lat-id="nearby_lat_school_<%=index%>" data-lng-id="nearby_lng_school_<%=index%>">点击这里打开地图选择经纬度</div>
    </dd>
</script>
<script type="text/html" id="nearbyshopjsontpl">
    <dd class="form-inline">
        <input type="text" name="row[<%=name%>][<%=index%>][name]" class="form-control" placeholder="名称" value="<%=row['name']%>" size="10">
        <input type="text" id="nearby_lng_shop_<%=index%>" name="row[<%=name%>][<%=index%>][lng]" class="form-control" placeholder="经度" value="<%=row['lng']%>" size="10">
        <input type="text" id="nearby_lat_shop_<%=index%>" name="row[<%=name%>][<%=index%>][lat]" class="form-control" placeholder="纬度" value="<%=row['lat']%>" size="10">
        <input type="text" name="row[<%=distance%>][<%=index%>][distance]" class="form-control" placeholder="距离" value="<%=row['distance']%>" size="10">
        <span class="btn btn-sm btn-danger btn-remove"><i class="fa fa-times"></i></span> <span class="btn btn-sm btn-primary btn-dragsort"><i class="fa fa-arrows"></i></span>
        <div style="color: #18bc9c;" data-toggle="addresspicker" data-lat-id="nearby_lat_shop_<%=index%>" data-lng-id="nearby_lng_shop_<%=index%>">点击这里打开地图选择经纬度</div>
    </dd>
</script>
<script type="text/html" id="nearbyhospitaljsontpl">
    <dd class="form-inline">
        <input type="text" name="row[<%=name%>][<%=index%>][name]" class="form-control" placeholder="名称" value="<%=row['name']%>" size="10">
        <input type="text" id="nearby_lng_hospital_<%=index%>" name="row[<%=name%>][<%=index%>][lng]" placeholder="经度" class="form-control" value="<%=row['lng']%>" size="10">
        <input type="text" id="nearby_lat_hospital_<%=index%>" name="row[<%=name%>][<%=index%>][lat]" placeholder="纬度" class="form-control" value="<%=row['lat']%>" size="10">
        <input type="text" name="row[<%=distance%>][<%=index%>][distance]" class="form-control" placeholder="距离" value="<%=row['distance']%>" size="10">
        <span class="btn btn-sm btn-danger btn-remove"><i class="fa fa-times"></i></span> <span class="btn btn-sm btn-primary btn-dragsort"><i class="fa fa-arrows"></i></span>
        <div style="color: #18bc9c;" data-toggle="addresspicker" data-lat-id="nearby_lat_hospital_<%=index%>" data-lng-id="nearby_lng_hospital_<%=index%>">点击这里打开地图选择经纬度</div>
    </dd>
</script>